package com.example.junit;

import com.example.junit.bean.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * ClassName:testJUnit
 * Package:com.example.junit
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/12-8:42
 * @Version:v1.0
 */

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class testJUnit {


    @Autowired
    private User user;

    @Test
    public void testJUnit() {
//        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
//        User user = applicationContext.getBean("user", User.class);
        System.out.println(user.getName());
    }
}
